/* 去重 */
let arr = [1,1,2,2,3,3,4];
let set = new Set(arr);
arr = [...set]
console.log('arr',arr);



/* 判断集合里面有无某个元素 */
console.log(set.has(1));
console.log(set.has(5));

/* 获取两个集合交集 */

let set2 = new Set([2,3,1,1,3])
let set3 = new Set(arr.filter(item => set2.has(item)))
console.log([...set3]);

